﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BxClick : MonoBehaviour
{

    public RectTransform rectTransform;
    public CheckTouch checkTouch;
    // Start is called before the first frame update
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        Vector3 pos = Vector3.zero;
        if (Input.GetMouseButtonDown(0))
        {
            pos = Input.mousePosition;
        }
        if (Input.touchCount > 0)
        {
            pos = Input.GetTouch(0).position;
        }
        if (pos != Vector3.zero)
        {
            if (RectTransformUtility.RectangleContainsScreenPoint(rectTransform, pos))
            {
                checkTouch.TouchCheck();
            }
        }
    }


}
